#ifndef _SDCF_H
#define _SDCF_H

//#include <stdio.h>
#include "dr_api.h"
#include "libdasm.h"
#include <windows.h>

////////////////////////// macro anouncement //////////////////////////

# define DISPLAY_STRING(msg) dr_messagebox(msg)
# define DIRSEP '\\'
# define CFG_FILE_PREFIX "cfg_"

/* SDCF runtime status */
typedef struct RTSTATUS{
	bool just_called;                    //if the last instruction is call            
	bool just_returned;					 //if the last instruction is ret
	bool init;                           //if the program is just initialized
	bool init_exe;                       //if the exe is initialized
	bool in_mod_exe;                     //if the program is in module notepad.exe
	char current_module_name[50];        //name of the current module 
	
	/* constructor */
	RTSTATUS(bool just_called_in, bool just_returned_in,bool init_in, bool init_exe_in, bool in_mod_exe_in){
		just_called   = just_called_in;                    //if the last instruction is call            
		just_returned = just_returned_in;				   //if the last instruction is ret
		init          = init_in;                           //if the program is just initialized
		init_exe      = init_exe_in;                       //if the exe is initialized
		in_mod_exe    = in_mod_exe_in;                     //if the program is in module notepad.exe
	}
}RTSTATUS;

/*global variables anouncement */
extern RTSTATUS sdcf_status;                //current sdcf_status
extern file_t f;                            //global log file
extern file_t cg_f;                         //cg log file
extern uint client_id;                      //dr client id

/* get the module information pf the current bb */
void 
Get_Mod_Info(module_data_t* module);

/* print the instructions in the bb */
void 
BB_Print(void* drcontext, instrlist_t* bb);

#endif